package huawei.exam1;

import java.util.Scanner;

/**
 * @author : Rookie
 * @description : 质数因子
 * @date : 2022/12/11
 */
public class HJ6 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String numStr = scanner.nextLine();
        printPrimeFactor(Integer.parseInt(numStr));
    }

    private static void printPrimeFactor(int num) {
        StringBuffer sb = new StringBuffer();
        int temp = (int) Math.sqrt(num);
        for (int i = 2; i <= temp; i ++) {
            while (num % i == 0) {
                sb.append(i).append(" ");
                num /= i;
            }
        }
        if (num > 1) {
            sb.append(num);
        }
        System.out.println(sb);
    }
}
